
import {
  CollectWorkOrderStatusStatisticsRequest, SalesStatisticsRequest, MerchantsRequest, DistributionSalesRequest,
  TotalNumberOrdersRequest, SalesRequest, HotSellingGoodsRequest, PartnersRequest, TotalNumberPointsRequest
} from '@/api'
export default {
  namespaced: true,
  state: {
  },
  mutations: {
  },
  actions: {
    // 工单统计
    async AcCollectWorkOrderStatusStatistics (store, time) {
      const res = await CollectWorkOrderStatusStatisticsRequest(time)
      return res.data
    },
    async AcSalesStatistics (store, time) {
      // 销售统计，collectType ， 1按日，2按月
      const res = await SalesStatisticsRequest(time)
      return res.data
    },
    // 订单总数
    async AcTotalNumberOrders (store, time) {
      const res = await TotalNumberOrdersRequest(time)
      return res.data
    },
    // 销售总价
    async AcSales (store, time) {
      const res = await SalesRequest(time)
      return res.data
    },
    // 热销商品
    async AcHotSellingGoods (store, time) {
      const res = await HotSellingGoodsRequest(time)
      return res.data
    },
    // 合作商点位数Top5
    async AcPartners () {
      const res = await PartnersRequest()
      return res.data
    },
    // 点位总数
    async AcTotalNumberPoints () {
      const res = await TotalNumberPointsRequest()
      return res.data
    },
    async AcMerchants () {
      const res = await MerchantsRequest()
      return res.data
    },
    async AcDistributionSales (store, time) {
      console.log(time)
      const res = await DistributionSalesRequest(time)
      return res.data
    }
  }
}
